//
//  LXDSingerCollectionViewCell.m
//  BLDMusics
//
//  Created by lxd on 16/3/20.
//  Copyright © 2016年 李晓丹. All rights reserved.
//

#import "LXDSingerCollectionViewCell.h"

@interface LXDSingerCollectionViewCell ()

/**分类图片*/
@property (nonatomic, retain) UIImageView *singerImage;

/**分类*/
@property (nonatomic, retain) UILabel *titleLabel;

@end

@implementation LXDSingerCollectionViewCell


- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createControl];
    }
    return self;
}


-(void)createControl {
    
    self.singerImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_singerImage];
    
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_titleLabel];
    _titleLabel.font = [UIFont systemFontOfSize:16];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    _singerImage.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height - 20);
    _singerImage.layer.cornerRadius = 8;
    _singerImage.layer.masksToBounds = YES;
    _titleLabel.frame = CGRectMake(0, self.bounds.size.height - 20, self.bounds.size.width, 20);
    _titleLabel.backgroundColor = [UIColor clearColor];
}

/**
 *  歌手
 *
 *  @param model 歌手model
 */
- (void)setModel:(LXDSingerModel *)model {
    _model = model;
    
    [_singerImage sd_setImageWithURL:[NSURL URLWithString:self.model.pic_url] placeholderImage:PLACEHOLDER];
    
    _titleLabel.text = self.model.title;
    
}


/**
 *  专辑
 */

- (void)setSpecialModel:(LXDSpecialModel *)specialModel {
    _specialModel = specialModel;
    [_singerImage sd_setImageWithURL:[NSURL URLWithString:self.specialModel.picUrl
                                      
                                      
                                      
                                      ] placeholderImage:PLACEHOLDER];
    
    _titleLabel.text = self.specialModel.name;
}


@end
